import React from 'react';
import ReactDom from 'react-dom';

import Dli from './DlI';

class DUl extends React.Component{
    constructor(props){
        super(props);
        this.state = {num:0};
        this.chuli = this.chuli.bind(this);
    }

    chuli(){
        ++this.state.num;
        if(!(this.state.num%5)){
            this.setState({num:this.state.num});
        }

    }

    render(){
        return <ul>
            <li>{this.state.num}</li>
            <Dli onFive = {this.chuli}/>
        </ul>;
    }
}

ReactDom.render(<DUl />, document.querySelector('#app'));
